<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>点击按钮添加文本框</title>
  <style>
    body {
      font-family: Arial, sans-serif;
    }

    button {
      margin-bottom: 10px;
    }
  </style>
</head>

<body>
  <h2>点击按钮添加文本框</h2>
  <button onclick="addInputField()">添加文本框</button>
  <div id="textBoxContainer"></div>

  <script>
    function addInputField() {
      // 创建一个新的输入框元素
      const newInput = document.createElement('input');
      newInput.type = 'text';
      newInput.placeholder = '请输入内容';

      // 获取存放文本框的容器元素
      const textBoxContainer = document.getElementById('textBoxContainer');

      // 将新创建的输入框添加到容器中
      textBoxContainer.appendChild(newInput);
    }
  </script>
</body>

</html>